package com.java.function.lambda;

import com.java.function.service.IBufferedReaderInterface;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class LambdaDemo {

    private static String readFile(IBufferedReaderInterface p) throws IOException {
        try(BufferedReader br = new BufferedReader(new FileReader("test.txt"))){
            return p.process(br);
        }
    }

    public static void main(String[] args) throws IOException{
        System.out.println(LambdaDemo.readFile(br -> br.readLine()));

    }

}
